import React , {Component} from "react"
export default class CommonHead extends Component{
    goback=()=>{
        const {history} = this.props;
        history.goBack();   //go(-1)
    }
    render(){
        const {title,show,urls} = this.props;
        return (
           <div className="header" style={{borderBottom:title?0:"1px solid #bcbbc0"}}>
                <header>
                    <div onClick={this.goback} className="back" style={{display:show?"block":'none'}} >
                        <i className="iconfont icon-fanhui"></i>
                    </div>
                    <span style={{display:title?"block":'none'}}>
                        {title}
                    </span>
                    <img src={urls} style={{display:title?"none":'inline-block'}}/>
                </header>
           </div>
        )
    }
}
CommonHead.propTypes = {
   title:React.PropTypes.bool
}